3.1.60 \(\int \cos ^2(c+d x) (A+B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [60]

Optimal. Leaf size=42 \[ \frac {1}{2} (A+2 C) x+\frac {B \sin (c+d x)}{d}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d} \]

[Out]

1/2*(A+2*C)*x+B*sin(d*x+c)/d+1/2*A*cos(d*x+c)*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {4132, 2717, 4130, 8} \begin {gather*} \frac {A \sin (c+d x) \cos (c+d x)}{2 d}+\frac {1}{2} x (A+2 C)+\frac {B \sin (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

((A + 2*C)*x)/2 + (B*Sin[c + d*x])/d + (A*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 4130

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e
+ f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + Dist[(C*m + A*(m + 1))/(b^2*m), Int[(b*Csc[e + f*x])^(m + 2), x], x] /
; FreeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]

Rule 4132

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rubi steps

\begin {align*} \int \cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=B \int \cos (c+d x) \, dx+\int \cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {B \sin (c+d x)}{d}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} (A+2 C) \int 1 \, dx\\ &=\frac {1}{2} (A+2 C) x+\frac {B \sin (c+d x)}{d}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 55, normalized size = 1.31 \begin {gather*} C x+\frac {A (c+d x)}{2 d}+\frac {B \cos (d x) \sin (c)}{d}+\frac {B \cos (c) \sin (d x)}{d}+\frac {A \sin (2 (c+d x))}{4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

C*x + (A*(c + d*x))/(2*d) + (B*Cos[d*x]*Sin[c])/d + (B*Cos[c]*Sin[d*x])/d + (A*Sin[2*(c + d*x)])/(4*d)

________________________________________________________________________________________

Maple [A]
time = 0.37, size = 45, normalized size = 1.07

method result size
risch \(\frac {A x}{2}+C x +\frac {B \sin \left (d x +c \right )}{d}+\frac {A \sin \left (2 d x +2 c \right )}{4 d}\) \(35\)
derivativedivides \(\frac {A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \sin \left (d x +c \right )+C \left (d x +c \right )}{d}\) \(45\)
default \(\frac {A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \sin \left (d x +c \right )+C \left (d x +c \right )}{d}\) \(45\)
norman \(\frac {\left (-\frac {A}{2}-C \right ) x +\left (-\frac {A}{2}-C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {A}{2}+C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {A}{2}+C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2 A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (A -2 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(155\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(A*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+B*sin(d*x+c)+C*(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 42, normalized size = 1.00 \begin {gather*} \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A + 4 \, {\left (d x + c\right )} C + 4 \, B \sin \left (d x + c\right )}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*A + 4*(d*x + c)*C + 4*B*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 2.46, size = 33, normalized size = 0.79 \begin {gather*} \frac {{\left (A + 2 \, C\right )} d x + {\left (A \cos \left (d x + c\right ) + 2 \, B\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*((A + 2*C)*d*x + (A*cos(d*x + c) + 2*B)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(A+B*sec(d*x+c)+C*sec(d*x+c)**2),x)

[Out]

Integral((A + B*sec(c + d*x) + C*sec(c + d*x)**2)*cos(c + d*x)**2, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 86 vs. \(2 (38) = 76\).
time = 0.41, size = 86, normalized size = 2.05 \begin {gather*} \frac {{\left (d x + c\right )} {\left (A + 2 \, C\right )} - \frac {2 \, {\left (A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*((d*x + c)*(A + 2*C) - 2*(A*tan(1/2*d*x + 1/2*c)^3 - 2*B*tan(1/2*d*x + 1/2*c)^3 - A*tan(1/2*d*x + 1/2*c) -
 2*B*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^2)/d

________________________________________________________________________________________

Mupad [B]
time = 2.50, size = 34, normalized size = 0.81 \begin {gather*} \frac {A\,x}{2}+C\,x+\frac {A\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,\sin \left (c+d\,x\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2*(A + B/cos(c + d*x) + C/cos(c + d*x)^2),x)

[Out]

(A*x)/2 + C*x + (A*sin(2*c + 2*d*x))/(4*d) + (B*sin(c + d*x))/d

________________________________________________________________________________________